<template>
	<view class="bigView">
		<!-- <z-paging ref="paging" v-model="dataList" @query="queryList"> -->
			<!-- <navBar slot="top" :title="trainingType=='1'?'员工培训通知':'员工活动通知'"></navBar> -->
			<view class="itemView">
				<view class="itemTitle">
					<view style="color: #000000;font-size: 16px;font-weight: bold;">{{data.theme}}</view>
				</view>
				<u-parse class="itemContent" :content="data.content" :lazyLoad="true"></u-parse>
			</view>
		<!-- </z-paging> -->
	</view>
</template>

<script>
	// import navBar from "@/components/nav_bar.vue"
	import training from '@/api/training.js'
	export default{
		components:{
			// navBar
		},
		data(){
			return {
				bottom:0,
				trainingType:'',
				data:{},
				currentId:'',
				dataList:[],
			}
		},
		mounted() {
			uni.getSystemInfo({success: (e) => {
				let custom = wx.getMenuButtonBoundingClientRect();
				this.bottom = custom.bottom;
			}})
			// this.listRequest()
		},
		onLoad(options) {
			if(options.id){
				console.log(options.id)
				this.currentId = options.id;
				this.queryByIdHandle()
			}
		},
		onShareAppMessage() {
			return{
				title: this.data.theme,
				path: '/packageDcjy/pages/training/detail?id='+this.currentId,
				success(res) {
					console.log('分享成功', res);
				},
				fail(err) {
					console.error('分享失败', err);
					uni.showModal({
						title:err
					})
				}
			}
		},
		onShareTimeline() {
			return {
				title: this.data.theme,
				path: '/packageDcjy/pages/training/detail?id='+this.currentId
			}
		},
		methods:{
			queryByIdHandle(){
				training.queryByIdHandle({id:this.currentId}).then(res =>{
					this.data = res;
				}).catch(err =>{
					
				})
			}
		},
		onReady() {
			
		}
	}
</script>

<style lang="scss" scoped>
.bigView{
	width: 100vw;
	height: 100vh;
	background-color: #F7F7F7;
	display: flex;
	flex-direction: column;
}
.topView{
	flex-grow: 1;
	// width: 100vw;
	// background-color: green;
	display: flex;
	flex-direction: column;
	width: 100vw;
	overflow-y: auto;
}
.itemView{
	display: flex;
	flex-direction: column;
	width: calc(100vw - 32px);
	border-radius: 12px;
	margin-left: 16px;
	// padding: 12px;
	background-color: white;
	margin-top: 8px;
	.itemTitle{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 12px;
	}
	.itemContent{
		padding: 0 12px 12px 12px;
		font-size: 12px;
		color: #333333;
		// margin-top: 12px;
	}
}
table, td, th {
  border-color: #ddd;
  border-width: 1px;
  border-style: solid;
}
</style>